package net.hoobo.lookzw.domain;

import com.alibaba.fastjson.JSONObject;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;

@Document(collection = "visit_records")
public class VisitRecord implements Serializable{
    @Indexed
    @Field("user_id")
    private Long UserId;

    @Indexed
    @Field("start_time")
    private Date StartTime;

    @Indexed
    @Field("end_time")
    private Date EndTime;

//    private boolean IsRecord;

    public Date getStartTime() {
        return StartTime;
    }

    public Date getEndTime() {
        return EndTime;
    }

    public void setUserId(Long userId) {
        this.UserId = userId;
    }

    public Long getUserId() {

        return UserId;
    }

    public void setStartTime(Date startTime) {
        StartTime = startTime;
    }

    public void setEndTime(Date endTime) {
        EndTime = endTime;
    }

    public HashMap toMap(){
        HashMap json = new HashMap();
        json.put("Id", UserId);
        json.put("StartTime", StartTime);
        json.put("EndTime", EndTime);
        return json;
    }
}
